import { createRouter, createWebHistory } from 'vue-router'
// 导入组件
import Login from '@/views/Login.vue';
import Layout from '@/views/Layout.vue';
import User from '@/views/User.vue';
import Home from '@/views/Home.vue';
import Article from '@/views/Article.vue';
import Notify from '@/views/Notify.vue';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/',
      name: 'Layout',
      component: Layout,
      children: [
        {
          path: 'user',
          name: 'User',
          component: User
        },
        {
          path: 'home',
          name: 'Home',
          component: Home
        },
        {
          path: 'article',
          name: 'Article',
          component: Article
        },
        {
          path: 'notify',
          name: 'Notify',
          component: Notify
        }
      ]
    }
  ]
})

export default router
